package com.lsy.poi.cell.extractor;

import java.util.Date;

import org.apache.poi.xssf.usermodel.XSSFCell;

import com.lsy.poi.exception.cell.ExtractorException;

public class DateCellExtractor extends CellExtractor {


	@Override
	public Date doExtract(XSSFCell cell) throws ExtractorException {
		if(cell == null) return null;
		
		Date cellValue;
		
		try {
			cellValue = cell.getDateCellValue();
		} catch (IllegalStateException e) {
			throw new ExtractorException(cell, "按 日期 类型");
		}
		
		return cellValue;
	}
	
	
	
}
